<!DOCTYPE html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>宽带组 : 项目组成员管理主页</title>  <link href="../../css/bootstrapmin.css" rel="stylesheet" media="screen">
<link href="../../css/style.css" rel="stylesheet">
<script type="text/javascript" src="../../js/header.js"></script>
</head>
<?php
require("header.php");
?>
<!-- end of header -->
 
    <div id= "achievement">
	<?php
	require("../../DBops.php");
	session_start();
	$con = connect("localhost", "root", "", "lab");
	$result = query($con, "*", "personalinfo", "ID", $_SESSION['user']);
	$row = mysql_fetch_array($result);
	$adminID=$row['adminID'];
	$role=$row['role'];
	
	
	if(isset($_SESSION['user']))
	{
		echo "<div style='height:30px;background:#A4D3EE;'>
		      
              <p  style='margin-right:10px;float:right;'>登录为: <a href = \"../../infor.php?id=".$_SESSION['user']."\">".$_SESSION['user']."</a></font>&nbsp&nbsp
			  <a  onclick=\"if(confirm('确定要退出系统吗?')){parent.location.href ='../../logout.php'}\" href=\"javascript:void(0)\">退出</a></font></p></div>";
	}

?>
 
<div style="width:700px;height:400px;float:left">
		<p >&nbsp;&nbsp;<strong>项目组成员管理</strong></p>


<?php
	$con = connect("localhost", "root", "", "lab");

	

	echo"<div class='table sectionedit2'>
		<table class='inline'>
			<tbody>
			";
			$result = mysql_query("select * from projecteam");
			
			
			
			WHILE($row = mysql_fetch_array($result)){
				echo"<tr class='row0'>";
				
				echo"
				<th class='col0 leftalign'>";
				if($adminID==$row['ID']||$role=='administrator'||$role=='teacher')echo"<a href='TeamMember.php?teamid=".$row['ID']."' title='".$row['name']."'>".$row['name']."</a> ";
				else echo"".$row['name']."";echo"</th>";
				$result1 = mysql_query("select * from personalinfo where projecteamID=".$row['ID']."");
				while($row1=mysql_fetch_array($result1)){
					if($row1['role']=='student')
					echo"<td class='col0'>".$row1['name']."</td>";
				}
				echo"</tr>";
		}
		
	?>

	
	
</tbody></table>
<hr>

</div>  
<br/><br/>


</body></html>